﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Godot.core
{
    public class ScriptServer
    {
        private const int MAX_LANGUAGES = 4;

        private static ScriptLanguage[] _languages = new ScriptLanguage[MAX_LANGUAGES];
        private static int _language_count = 0;
        private static bool _scripting_enabled = false;

        public static int language_count
        {
            get
            {
                return _language_count;
            }
        }

        public static bool is_scripting_enabled
        {
            set
            {
                _scripting_enabled = value;
            }

            get
            {
                return _scripting_enabled;
            }
        }

        public static ScriptLanguage get_language(int p_idx)
        {
            if (p_idx >= _language_count)
                return null;
            return _languages[p_idx];
        }

        public static void register_language(ScriptLanguage p_lang)
        {
            if (_language_count >= MAX_LANGUAGES)
                return;
            _languages[_language_count++] = p_lang; 
        }
    }
}
